
 <script>
 $(function() {
    var name = $("#name"),
        email = $("#email"),
        password = $("#password"),
        allFields = $([]).add(name).add(email).add(password),
        tips = $(".validateTips");

         function updateTips(t) {
             tips.text(t).addClass("ui-state-highlight");
             setTimeout(function() {
                 tips.removeClass("ui-state-highlight", 1500);
             }, 500);
         }

         function checkLength(o, n, min, max) {
             if (o.val().length > max || o.val().length < min) {
                 o.addClass("ui-state-error");
                 updateTips("Usuário " + n + " precisa ter de " +
                         min + " a " + max + ".");
                 return false;
             } else {
                 return true;
             }
         }
         function checkRegexp(o, regexp, n) {
             if (!(regexp.test(o.val()))) {
                 o.addClass("ui-state-error");
                 updateTips(n);
                 return false;
             } else {
                 return true;
             }
         }
         $("#dialog-form").dialog({
             autoOpen: true,
             height: 550,
             width: 650,
             modal: true,
             close: function() {
                 allFields.val("").removeClass("ui-state-error");
             }
         });
         $("#create-user")
                 .button()
                 .click(function() {
             $("#dialog-form").dialog("open");
         });
     });
</script>
<div id="dialog-form" title="Criar Novo Usuário">
   
    <?php echo $this->element('usuario/cadastro'); ?>
    <?php if(isset($erros)) print_r($erros);?>
    
</div>
ERROS<br>
$$$$$$$$$$$$$$$$$$$$$$$<br>
<?php print_r($this->request->data)?>
$$$$$$$$$$$$$$$$$$$$$
<br/>